package com.hornsun.repository.mapper;

import com.hornsun.domain.dbo.MemberWechat;
import com.hornsun.domain.dbo.MemberWechatExample;
import java.util.List;

import com.hornsun.domain.dbo.Statistics;
import com.hornsun.domain.dto.MemberWechatDTO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Component;

@Component
public interface MemberWechatMapper {
    long countByExample(MemberWechatExample example);

    int deleteByExample(MemberWechatExample example);

    int deleteByPrimaryKey(String openid);

    int insert(MemberWechat record);

    int insertSelective(MemberWechat record);

    List<MemberWechat> selectByExampleWithRowbounds(MemberWechatExample example, RowBounds rowBounds);

    List<MemberWechat> selectByExample(MemberWechatExample example);

    MemberWechat selectByPrimaryKey(String openid);

    int updateByExampleSelective(@Param("record") MemberWechat record, @Param("example") MemberWechatExample example);

    int updateByExample(@Param("record") MemberWechat record, @Param("example") MemberWechatExample example);

    int updateByPrimaryKeySelective(MemberWechat record);

    int updateByPrimaryKey(MemberWechat record);
    //通过openid查询memberGuid
    String selectMemberGuidByOpenid(String openid);

    //绑定会员账号
    void boundMember(@Param("openid") String openid,@Param("memberGuid") String memberGuid);

    //统计性别
    List<Statistics> genderStatistics();

    //系统统计
    List<Statistics> terminalStatistics();

    //s所在地统计
    List<Statistics> cityStatistics();

    //获取会员信息
    List<MemberWechatDTO> getMemberInfo(int offset);

    //通过手机号获取会员信息
    List<MemberWechatDTO> getMemberInfoByMobile(String mobile);

    //通过昵称获取会员信息
    List<MemberWechatDTO> getMemberInfoByNickname(String nickname);

    //添加健康豆
    void addHealthBeans(@Param("openid") String openid,@Param("count")int count);

}